import Layout from '@/layout/index.vue'
import { metaList } from '@/views/meta'
import { getRoutersByModules, sortRoutesByOrder } from 'vue3-common/utils/routerUtil'

const modules = {
  ...import.meta.glob('@/views/blog/**/*.vue'),
  ...import.meta.glob('@/views/dashboard/**/*.vue'),
  ...import.meta.glob('@/views/monitor/**/*.vue')
}

const adminRoutes = getRoutersByModules(modules, Layout, metaList)

export default sortRoutesByOrder(adminRoutes)
